State is just a snapshot of a process at a moment. 📸
| State | Name | Description |
|---|---|---|
| R | Running | The process is running or ready to run. |
| S | Sleeping | Waiting for an event or I/O. (Very common). |
| T | Stopped | Suspended by a signal like SIGSTOP or SIGSTP (Ctrl+Z). |
| Z | Zombie 🧟 | Finished execution but still in the process table. |
Zombie Example: A person has passed away, but their official records still show them as "Alive" because the death certificate hasn't been processed. The record exists, but the entity is gone. ☠ï¸
Signals change the state of a process. Here is the relationship:
| SIGNAL | Effect / New State |
|---|---|
| SIGINT | Gone (Stopped & Cleared) |
| SIGTERM | Gone (Polite Stop) |
| SIGSTP | T (Stopped/Paused) |
| SIGSTOP | T (Stopped/Paused) |
| SIGCONT | R or S (Running/Sleeping) |
| SIGKILL | Gone (Forced Kill) |
Note:
S+: Foreground Sleeping (Process is running in the foreground).S: Background Sleeping (Process is running in the background).- The
+sign indicates Foreground processes.
Ctrl + Shift + R (or your shortcut).sleep 500ps aux | grep "sleep 500"S+ (Sleeping + Foreground).Ctrl + Z) and send to background (bg).ps command again.S (Sleeping, no +).SIGSTOP to the PID.